package com.keeson.android_cli.base;

import java.io.Serializable;

/**
 * Created by jiaqiZHou
 * on 2020/12/4
 */
public class BaseRespose<T> implements Serializable {

    private static final long serialVersionUID = 2484868567614623456L;
    public int code;
    public String message;
    public T data;

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return message;
    }

    public void setMsg(String msg) {
        this.message = msg;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    /**
     * 请求成功
     *
     * @return
     */
    public boolean isSuccess() {
            return 10000 == code;
    }

    public boolean isRelogin() {
        return 40001 == code || 40002==code || 10016==code;
    }
}
